package com.test.designPattern.behaviorType.interpreterPattern;

/**
 * 非终结符表达式
 *
 * @author wangjie
 * @version V1.0
 * @date 2020/4/9
 */
public class NumberInterpreter implements Interpreter {
    private Double number;

    public NumberInterpreter(Double number) {
        this.number = number;
    }

    public NumberInterpreter(String number) {
        this.number = Double.parseDouble(number);
    }

    @Override
    public double interpret() {
        return this.number;
    }
}
